IF "#INSTVER#"=="INST16" GetProfileString("Install", "Path", "%InstallPath%", "%IniFile%", %InstallPath%)
IF "#INSTVER#"=="INST32" RegGetSetting(2, "SOFTWARE\%Company%\%Application%\Install", "Path", "%InstallPath%", %InstallPath%)
AddChar(%InstallPath%, "\")
SET %InstallDrive%=Left("%InstallPath%", 2)
// Language
SetLanguage("UsEnglish")
// Create all the objects
CreateBackdrop("DEFAULTBACKDROP")
CreateControl("Text","%Application% Setup",-1,20,10,0,0,1048576,"Times New Roman",50,3,16777215,0)
CreateControl("Text","Install/De-Install created using Setup Builder Version 5.02.001/32|Copyright ⌐ 1993 - 1998 GPP Software|",-1,20,0,0,0,1114112,"Times New Roman",17,3,16777215,0)
EndObject()
// Close Setup Program
HideSetup()
// Display appropriate backdrop
GetScreenWidth(%Width%)
SET %BackDrop%="DEFAULTBACKDROP"
IF "%BackDrop%" != "(None)" ShowBackdrop("%BackDrop%")
// Determine if s/w is already installed
SET %DoUpgrade% = FALSE
IF "#INSTVER#"=="INST16" GetProfileString("Install", "DeInstallScript", "%InstallPath%DEINST.INF", "%IniFile%", %DeInstall%)
IF "#INSTVER#"=="INST32" RegGetSetting(2, "SOFTWARE\%Company%\%Application%\Install", "DeInstallScript", "%InstallPath%DEINST.INF", %DeInstall%)
IF "#INSTVER#"=="INST16" GetProfileString("Install", "Installed", "0", "%IniFile%", %Installed%)
IF "#INSTVER#"=="INST32" RegGetInt(2, "SOFTWARE\%Company%\%Application%\Install", "Installed", 0, %Installed%)
IF %Installed% != 0 GOTO :GOTVERSION
SET %DoUpgrade% = TRUE
SET %DeInstall% = "%InstallPath%DEINST.INF"
CheckExists("%DeInstall%")
SET %Installed% = %ERROR%
IF %ERROR% == TRUE GOTO :GOTVERSION
SET %DeInstall% = "%InstallPath%DEINST.SCR"
CheckExists("%DeInstall%")
SET %Installed% = %ERROR%
IF %ERROR% == TRUE GOTO :GOTVERSION
SET %DeInstall% = "%InstallPath%eBreakin.SCR"
CheckExists("%DeInstall%")
SET %Installed% = %ERROR%
:GOTVERSION
// Welcome Dialog
:BACK1
SET %Message1%="Welcome to the %Application% Installation Program."
SET %Message2%="This program will install the %Application% software in the directory you specify on your hard disk."
SET %Message3%="(Compuserve ID: 100105,536)||Setup is supplied with the Setup Builder|software and is the copyright of G.Plowman"
DialogBox("Welcome")
IF %ERROR% == IDCANCEL GOTO :EXIT
// Sort out where to install the software
// but only if the software isn't already installed
AddChar(%InstallPath%, "\")
SET %MakeDir% = %InstallPath%
SET %Temp% = Len(%MakeDir%)
IF %Temp% > 3 SET %Temp% = %Temp% - 1
SET %MakeDir% = Left(%MakeDir%, %Temp%)
IF %Installed% == TRUE GOTO :INSTALLED
// Ask the user where to install the software
// but only if the software isn't already installed
:RETRY
SET %Message1%="The install program will copy the %Application% files into the following directory:"
DialogBox("AskPath")
IF %ERROR% == IDBACK GOTO :BACK1
IF %ERROR% == IDCANCEL GOTO :EXIT
// Create installation directory
:INSTALLED
SET %InstallDrive% = Left("%InstallPath%", 2)
AddChar(%InstallPath%, "\")
SET %MakeDir% = %InstallPath%
SET %Temp% = Len(%MakeDir%)
IF %Temp% > 3 SET %Temp% = %Temp% - 1
SET %MakeDir% = Left(%MakeDir%, %Temp%)
MkDir(%MakeDir%)
IsWriteable(%MakeDir%)
IF %ERROR% == FALSE GOTO :DIRERROR
// Save the installation directory/de-install script
IF "#INSTVER#"=="INST16" WriteProfileString("Install", "Path", "%MakeDir%", "%IniFile%")
IF "#INSTVER#"=="INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Install", "Path", "%MakeDir%")
SET %Temp% = ""
// Upgrade the de-install if required
IF %DoUpgrade% == FALSE GOTO :NODEINSTUPG
SET %Temp% = "%DeInstall%"
SET %DeInstall% = "%WindowsDirectory%GPPSOFT\eBreakin.001"
GetBackupName("%DeInstall%", %DeInstall%)
IF %Installed% == FALSE GOTO :NODEINSTUPG
Open("%DeInstall%", 10, WRITE)
WriteLine(10, "//$FILES$")
Close(10)
CopyFile("%Temp%","%DeInstall%",0,1,1)
:NODEINSTUPG
SET %DoUpgrade% = ""
IF "#INSTVER#"=="INST16" WriteProfileString("Install", "DeInstallScript", "%DeInstall%", "%IniFile%")
IF "#INSTVER#"=="INST32" RegWriteSetting(2, "SOFTWARE\%Company%\%Application%\Install", "DeInstallScript", "%DeInstall%")
IF "#INSTVER#"=="INST16" WriteProfileString("Install", "Installed", "1", "%IniFile%")
IF "#INSTVER#"=="INST32" RegWriteInt(2, "SOFTWARE\%Company%\%Application%\Install", "Installed", 1)
// Decide whether an icon folder/icons is to be created
MessageBox("Setup can create an Icon Folder for the %Application% application.||Do you wish to create an Icon Folder and icons ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
AddDeInstall("$STARTUP$","MessageBox(^034The %Application% software is about to be removed from your machine.^^013^^013All files, directories and the appropriate Icon Folder will be deleted.^^013^^013Are you sure you wish to continue ?^034, ^034%Caption%^034, MB_YESNO, MB_ICONQUESTION)")
MessageBox("The %Application% software requires %Required%K bytes of disk space and there is only %Space%K bytes free on your %InstallDrive% drive.||Do you wish to continue to install the software ?", "%Caption%", MB_YESNO, MB_ICONQUESTION)
IF %ERROR% == IDNO GOTO :EXIT
:GOTSPACE
// Do the file copying
SET %TotalBlocks%=15
CopyFile(%TotalBlocks%)
CheckExists("%CurrentDrive%DISK01", "Please insert the diskette labeled 'DISK01'")
SET %Message1%="|%Application% installation has been successfully completed."
SET %Message2%=""
DialogBox("OkBox")
// User defined code - installation completion
MessageBox("It is better to start again Windows to be sure the game works. Do you want start again Windows now ?","Re-dΘmarrer Windows", MB_YESNO, MB_ICONQUESTION)
IF %ERROR% == IDYES ExitWindows(TRUE)
GOTO :END
// User decided to quit
:EXIT
EndCopyFile()
SET %Message1%="Installation has been terminated. You should re-run this installation program at a later time to install %Application%."
SET %Message2%="|The %Application% software has not been installed."
DialogBox("OkBox")
GOTO :END
// Error
:ERROR
EndCopyFile()
SET %Message1%="An error occured during installation of the %Application% software."
SET %Message2%="|The %Application% software has not been fully installed."
DialogBox("OkBox")
GOTO :END
// Failed to create install directory
:DIRERROR
SET %Message1%="|Failed to create the installation directory '%MakeDir%'."
SET %Message2%="|Unable to install the %Application% software in the specified directory."
DialogBox("OkBox")
GOTO :RETRY
:END
// Final tidy up - close files and remove components from H/D